package web.base.user.facade;

import web.base.user.exception.UserException;
import web.base.user.message.UserRequest;
import web.base.user.message.UserResponse;
import web.base.user.message.UserSearchRequest;
import web.base.user.message.UserSearchResponse;
import web.base.user.validation.LoginGroup;
import web.base.user.validation.RegisterGroup;
import web.common.core.annotation.Facade;
import web.common.core.annotation.Validation;
import web.common.core.validation.group.SearchGroup;

import javax.validation.constraints.NotNull;

/**
 * @author Jin Zheng
 * @since 2022-01-03
 */
@Facade
public interface UserFacade {

	UserResponse register(@Validation({RegisterGroup.class}) UserRequest request) throws UserException;

	UserResponse login(@Validation({LoginGroup.class}) UserRequest request) throws UserException;

	UserResponse get(@NotNull(message = "用户ID不能为空") Integer id) throws UserException;

	UserSearchResponse search(@Validation({SearchGroup.class}) UserSearchRequest request) throws UserException;

}
